Skip to content

Add performance instrumentation to key methods#689

Merged
smahima27 merged 6 commits intomainfrom
P4DEVOPS-8570
Dec 26, 2025
Merged

Add performance instrumentation to key methods#689
smahima27 merged 6 commits intomainfrom
P4DEVOPS-8570

Conversation

@smahima27
Copy link
Copy Markdown
Contributor

No description provided.

- Add timing metrics to check_pool loop for monitoring cycle duration
- Add performance metrics to purge methods (pending, ready, completed queues)
- Performance metrics track operation duration using vmpooler_performance gauge
- Add warning logs for operations exceeding 5 second threshold in check_pool
- All existing metrics (clone, destroy) already have timing instrumentation
- Tests passing: 866 examples, 0 failures
…lining

- Add in-memory cache for /status endpoint with 30s TTL
- Cache keyed by view parameters to handle different query patterns
- Add cache clearing for tests to prevent interference
- Optimize get_queue_metrics to use single pipeline for all Redis calls
  - Previously made 7+ separate pipeline calls
  - Now combines all queue metrics into one pipeline (7n+2 operations)
  - Reduces Redis round trips and improves API response time
- Update unit tests to match new pipelining behavior
- All 866 tests passing
@smahima27 smahima27 requested a review from a team as a code owner December 24, 2025 08:28
Class variables are needed here because:
- Cache must be shared across all Sinatra app instances
- Class instance variables don't work in Sinatra's dynamic instantiation model
- This is a valid use case for class variables despite RuboCop warning
@smahima27 smahima27 merged commit 50efc5b into main Dec 26, 2025
4 checks passed
@smahima27 smahima27 deleted the P4DEVOPS-8570 branch December 26, 2025 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants